A modified ziggurat algorithm for generating exponentially- and normally-distributed pseudorandom numbers

نویسنده

  • Christopher D. McFarland
چکیده

The Ziggurat Algorithm is a very fast rejection sampling method for generating PseudoRandom Numbers (PRNs) from statistical distributions. In the algorithm, rectangular sampling domains are layered on top of each other (resembling a ziggurat) to encapsulate the desired probability density function. Random values within these layers are sampled and then returned if they lie beneath the graph of the probability density function. Here, we present an implementation where ziggurat layers reside completely beneath the probability density function, thereby eliminating the need for any rejection test within the ziggurat layers. In the new algorithm, small overhanging segments of probability density remain to the right of each ziggurat layer, which can be efficiently sampled with triangularly-shaped sampling domains. Median runtimes of the new algorithm for exponential and normal variates is reduced to 58% and 53% respectively (collective range: 41-93%). An accessible C library, along with extensions into Python and MATLAB/Octave are provided.

برای دانلود رایگان متن کامل این مقاله و بیش از 32 میلیون مقاله دیگر ابتدا ثبت نام کنید

ثبت نام

اگر عضو سایت هستید لطفا وارد حساب کاربری خود شوید

منابع مشابه

Ziggurat Revisited

Random numbers following a Standard Normal distribution are of great importance when using simulations as a means for investigation. The Ziggurat method (Marsaglia and Tsang, 2000; Leong, Zhang, Lee, Luk, and Villasenor, 2005) is one of the fastest methods to generate normally distributed random numbers while also providing excellent statistical properties. This note provides an updated impleme...

متن کامل

Hardware-Optimized Ziggurat Algorithm for High-Speed Gaussian Random Number Generators

Many scientific and engineering applications, which are increasingly being ported from software to reconfigurable platforms, require Gaussian-distributed random numbers. Thus, the efficient generation of these random numbers using few resources and allowing for high clocking rates is an important design factor in the application performance. In this paper, we demonstrate scalable implementation...

متن کامل

Algorithm for normal random numbers.

We propose a simple algorithm for generating normally distributed pseudorandom numbers. The algorithm simulates N molecules that exchange energy among themselves following a simple stochastic rule. We prove that the system is ergodic, and that a Maxwell-like distribution that may be used as a source of normally distributed random deviates follows in the N-->infinity limit. The algorithm passes ...

متن کامل

Algorithm 488: a Gaussian Pseudo-random Number Generator [g5]

We present an algorithm GRAND for generating normally distributed pseudo-random numbers, assuming the existence of a source of uniform random numbers. The method is exact, apart from the effect of rounding errors. The idea of using a rejection technique to avoid any elementary function evaluations is due to Von Neumann [4] and Forsythe [3], but our implementation requires less uniform samples p...

متن کامل

Generating Antithetic Random Variates in Simulation of a Replacement Process by Rejection Method

When the times between renewals in a renewal process are not exponentially distributed, simulation can become a viable method of analysis. The renewal function is estimated through simulation for a renewal process simulation for a renewal process with gamma distributed renewal times and the shape parameter a > 1. Gamma random deviates will be generated by means of the so called Acceptance Rejec...

متن کامل

ذخیره در منابع من


  با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید

عنوان ژورنال:
  • Journal of statistical computation and simulation

دوره 86 7  شماره 

صفحات  -

تاریخ انتشار 2016